<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>捕获委托</title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			ul{
				width: 100%;
				list-style: none;
			}
			li{
				width: 100%;
				background: red;
			}
		</style>
	</head>
	<body>
		<ul id='ull'>
			<li>
				<p>1.1</p>
				<p>1.2</p>
				<p>1.3</p>
			</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
		</ul>
	</body>
	<script type="text/javascript">
		var oUl = document.getElementById('ull');
	    var aLi = document.getElementsByTagName('li');

	  	oUl.onmouseover = function(ev){ 
	     	var event = ev||window.event;  // 获取event对象
	     	var target = event.target || event.srcElement; // 获取触发事件的目标对象
	    	// console.log(ev.target)
	     	if(target.nodeName.toLowerCase() == 'li'){  //判断目标对象是不是li
		        target.style.background = 'pink';
		    }
		}
	</script>
</html>
